<template>
  <div class="vip">
    <div class="vip-content">
      <div
        class="vip-content-top"
        :style="{background:styles.bgType==1?styles.colorBg:'url('+styles.img+')'}"
       >
        <div class="change-top">
          <div class="top-left">
            <el-image style="width: 50px; height: 50px;borderRadius:50%" :src="img" fit="cover"></el-image>
            <div class="vip-login">
              <p :style="{color:styles.colorName}">登录/注册</p>
              <span :style="{color:styles.colorName}">***********</span>
            </div>
          </div>
          <div class="top-right">
            <!-- <svg :style="{color:styles.colorName}" style="font-size:20px" class="icon" aria-hidden="true">
              <use xlink:href="#iconcaidan" />
            </svg> -->
          </div>
        </div>

        <div v-if="styles.vipStatus==1" class="setting-vip">
          <div class="vip-left">
            <span>优享会员卡</span>
            <span>2019-12-31到期</span>
          </div>
          <div class="vip-right">
              <span>查看详情</span>
          </div>
        </div>
        <img v-if="styles.vipStatus==1" class="cover" src="../../../assets/img/cover.png" alt="">
      </div>
      <div class="vip-content-bottom" v-if="styles.btnStatus.includes(true)">
        <div
          v-show="styles.btnStatus[i]"
          v-for="(v,i) in btnList"
          :key="i"
          :style="{borderColor:styles.colorBorder}"
        >
          <p :style="{color:styles.colorNumber}">{{v.num}}</p>
          <p :style="{color:styles.colorTitle}">{{v.name}}</p>
        </div>
      </div>

    </div>

  </div>
</template>

<script>
export default {
  name: "vip",
  data() {
    return {
      img: require("../../../assets/img/blank.png"),
      btnList: [
        { name: "余额", num: 0 },
        { name: "积分", num: 7 },
        { name: "优惠券", num: 25 },
        { name: "收藏", num: 10509 },
      ],
    };
  },
  props: ["styles"],
};
</script>


<style lang='less' scoped>
@import url("../../../assets/css/base.less");
.vip-content {
  background-size: 100%;

  .vip-content-top {
    padding: 50px 10px 0;
    position: relative;
    > .change-top {
      position: relative;
      padding-bottom: 20px;
      > .top-left {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        > .vip-login {
          margin-left: 10px;
          > p {
            font-size: 16px;
            font-weight: bold;
            color: #fff;
          }
          > span {
            font-size: 12px;
            opacity: 0.8;
          }
        }
      }
      > .top-right {
        position: absolute;
        right: 0;
        top: 0;
        color: #fff;
        font-size: 20px;
        font-weight: bold;
      }
    }
    >.setting-vip{
      display: flex;
      justify-content: space-between;
      align-items: center;
      background-color: #403633;
      color: #EECFBA;
      padding: 15px 15px 30px;
      border-radius: 10px 10px 0 0;
      >.vip-left{
        span:nth-of-type(1){
          padding-right: 10px;
        }
        span:nth-of-type(2){
          font-size: 12px;
          padding-left: 10px;
          border-left: 1px solid #999;
        }
      }
      >.vip-right{
        background-color:#EECFBA ;
        color: #403633;
        font-size: 10px;
        padding: 4px 10px;
        border-radius: 30px;
      }
    }
    >.cover{
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
    }
  }
  .vip-content-bottom {
    width: 95%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    color: #fff;
    background-color:#fff;
    margin:10px auto 0;
    padding: 10px 0 10px;
    border-radius: 10px;
    > div {
      text-align: center;
      > p:nth-of-type(1) {
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 5px;
      }
      >p:nth-of-type(2){
        font-size: 12px;
      }
    }
    > div:last-child {
      border-right: 0;
    }
  }
}
</style>
